package com.oet.persistence.entity;

// Generated Feb 6, 2010 3:22:38 PM by Hibernate Tools 3.2.4.GA

import java.util.Date;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.JoinTable;
import javax.persistence.Lob;
import javax.persistence.OneToMany;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;


/**
 * YdkAccount generated by hbm2java
 */
@Entity
@Table(name = "user_course_series", catalog = "oet")
public class UserCourseSeries implements java.io.Serializable {

	private Long id;
	private Long courseSeriesId;
	private String name;
	private Integer type;
	private Integer level;
	private Long teacherId;
	private String teacherName;
	private String description;
	private Integer capacity;
//	private Integer occupyNum;
	
	private Date startDate;
	private Date endDate;
	private Date lastModified;
	private Double totalPrice;
//	private Integer scoredNumber;
	
	private Customer customer;

	public UserCourseSeries() {
	}
	
	


	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "id", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}
	

	@Column(name = "course_series_id")
	public Long getCourseSeriesId() {
		return courseSeriesId;
	}
	public void setCourseSeriesId(Long courseSeriesId) {
		this.courseSeriesId = courseSeriesId;
	}


	
	@Column(name = "name", nullable = false, length = 250)
	public String getName() {
		return this.name;
	}
	public void setName(String name) {
		this.name = name;
	}
	
	

	@Column(name = "level")
	public Integer getLevel() {
		return level;
	}
	public void setLevel(Integer level) {
		this.level = level;
	}

	

	@Column(name = "description")
	@Lob
	public String getDescription() {
		return description;
	}
	public void setDescription(String description) {
		this.description = description;
	}

	
	@Column(name = "capacity")
	public Integer getCapacity() {
		return capacity;
	}
	public void setCapacity(Integer capacity) {
		this.capacity = capacity;
	}
	
//	@Column(name = "occupy_num")
//	public Integer getOccupyNum() {
//		return occupyNum;
//	}
//	public void setOccupyNum(Integer occupyNum) {
//		this.occupyNum = occupyNum;
//	}


	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "last_modified")
	public Date getLastModified() {
		return lastModified;
	}
	public void setLastModified(Date lastModified) {
		this.lastModified = lastModified;
	}

//	@Column(name = "score")
//	public Double getScore() {
//		return score;
//	}
//	public void setScore(Double score) {
//		this.score = score;
//	}
//
//	@Column(name = "scored_number")
//	public Integer getScoredNumber() {
//		return scoredNumber;
//	}
//	public void setScoredNumber(Integer scoredNumber) {
//		this.scoredNumber = scoredNumber;
//	}
	
	
	

	@Column(name = "type")
	public Integer getType() {
		return type;
	}
	public void setType(Integer type) {
		this.type = type;
	}


	@Column(name = "teacher_id")
	public Long getTeacherId() {
		return teacherId;
	}
	public void setTeacherId(Long teacherId) {
		this.teacherId = teacherId;
	}

	
	@ManyToOne(fetch = FetchType.LAZY, cascade = {CascadeType.PERSIST})
	@JoinTable(
            name="customer_user_course_series",
            joinColumns = @JoinColumn( name="user_course_series_pk"),
            inverseJoinColumns = @JoinColumn( name="customer_pk")
    )
    public Customer getCustomer() {
		return customer;
	}
	public void setCustomer(Customer customer) {
		this.customer = customer;
	}

	
	@Column(name = "teacher_name")
	public String getTeacherName() {
		return teacherName;
	}
	public void setTeacherName(String teacherName) {
		this.teacherName = teacherName;
	}
	
	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "start_date")
	public Date getStartDate() {
		return startDate;
	}
	public void setStartDate(Date startDate) {
		this.startDate = startDate;
	}

	@Temporal(TemporalType.TIMESTAMP)
	@Column(name = "end_date")
	public Date getEndDate() {
		return endDate;
	}
	public void setEndDate(Date endDate) {
		this.endDate = endDate;
	}




	@Column(name = "total_price")
	public Double getTotalPrice() {
		return totalPrice;
	}
	public void setTotalPrice(Double totalPrice) {
		this.totalPrice = totalPrice;
	}
	
	
	

}
